<?php
//ref: http://devzone.zend.com/article/3450 decorators etc.

	class Default_Form_Backend_StaticPage extends Default_Form_Common
	{
	    public function init()
	    {
			parent::init();
	    }

		public function add()
	    {

			$name = $this->createElement('text', 'name');
			$name->setLabel('Page Name')
					->setAttrib('size', 40)
	               	->setRequired(true)
	               	->setDescription('staticpages:page-name-samples')
	               	->addValidator('stringLength', false, array(3, 64))
	               	->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;

			$label = $this->createElement('text', 'label');
			$label->setLabel('Page Title')
					->setAttrib('size', 50)
	               	->setRequired(true)
	               	->addValidator('stringLength', false, array(3, 120))
	               	->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;



			$content = $this->createElement('textarea','static_page_content');
			$content->setLabel('Page Content')
					->setAttrib('id', 'page_content')
					->setAttrib('rows', 10)
					->setAttrib('class', 'htmleditor')
	               	->setRequired(true)
	               	//->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;

	        $isActive = $this->createElement('checkbox', 'isActive');
			$isActive->setLabel('is-active');


			$this->addElement($name)
			     ->addElement($label)
			     ->addElement($content)
			     ->addElement($isActive)
			     ;



	    }

		public function edit()
	    {
	    	$this->add();

			$editId = $this->createElement('hidden', 'editId');

			$this->addElement($editId);


	    }

	}
